/**
Company: Sarkar software technologys
WebSite: http://www.sarkar.cn
Author: yeganaaa
Date : 5/16/18
Time: 1:24 PM
 */

package Cn.Sarkar.IMS.Entities

import Cn.Sarkar.Entities.Common.Additional.IDescription
import Cn.Sarkar.Entities.Common.Additional.IName
import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.IMS.IProduct
import Cn.Sarkar.Entities.IMS.IStamp
import Cn.Sarkar.Entities.IMS.IType
import Cn.Sarkar.Entities.IMS.IUnit
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.IMS.DataBaseDefinations.Products

class Product(DataContext: IDataContext) : IProduct, BaseEntity(DataContext, Products) {
    var nameID by Products.NameID
    override var name: IName by hasOne(Products.NameID) { Name(it) }
    var descriptionID by Products.DescriptionID
    override var description: IDescription by hasOne(Products.DescriptionID) { Description(it) }
    override var image: String by Products.Image
    var typeID by Products.TypeID
    override var type: IType by hasOne(Products.TypeID) { Type(it) }
    var unitID by Products.UnitID
    override var unit: IUnit by hasOne(Products.UnitID) { Unit(it) }
    var stampID by Products.StampID
    override var stamp: IStamp by hasOne(Products.StampID) { Stamp(it) }

}